import 'package:flutter/material.dart';

class FunctionBtn extends StatelessWidget {
  const FunctionBtn(
      {super.key,
      this.backgroundColor = Colors.transparent,
      required this.onTap,
      required this.image,
      this.shape = BoxShape.rectangle,
      this.shadowColor = Colors.transparent});
  final Color backgroundColor;
  final String image;
  final GestureTapCallback onTap;
  final BoxShape shape;
  final Color shadowColor;

  // final List<BoxShadow> shadows;

  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: BoxDecoration(
        image: DecorationImage(
          image: AssetImage(image),
        ),
        shape: shape,
        //borderRadius: BorderRadius.circular(5),
        color: backgroundColor,
        boxShadow: [getShadow(context)],
        // border: Border.all(
        //   width: 1,
        //   color: Colors.white,
        // ),
      ),
      child: GestureDetector(
        onTap: onTap,
      ),
    );
  }

  BoxShadow getShadow(BuildContext context) {
    return BoxShadow(
      color: shadowColor,
      offset: const Offset(2, 2),
      blurRadius: 2,
      spreadRadius: 0.5,
    );
  }
}
